package com.example.text.controller;

import com.example.text.entity.Result;
import com.example.text.entity.User;
import com.example.text.service.UserService;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/api")
public class UserController {
    @Autowired
    private UserService userService;
    @PostMapping("/login")
    public Result login(@RequestBody User user){
        return userService.login(user);
    }

    @GetMapping("/test")
    public String test() {
        return "API is working";
    }






}